package com.yuanfeng.userms.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 用户绑定表
 * @TableName user_bind_connect
 */
@TableName(value ="user_bind_connect")
@Data
public class UserBindConnectEntity implements Serializable {
    /**
     * 绑定标记：mobie/微信/支付宝openid  绑定类型+openid
     */
    @TableId
    private String bindId;

    /**
     * 绑定类型  1:sinaweibo  2:qq   3:weixin 4.：支付宝  11:email  12:mobile
     */
    private Byte bindType;

    /**
     * 用户id
     */
    private String userId;

    /**
     * 绑定时间
     */
    private Date bindTime;

    /**
     * 第三方用户昵称
     */
    private String bindNickname;

    /**
     * 第三方用户头像地址
     */
    private String bindAvator;

    /**
     * 第三方用户身份认证编号
     */
    private String bindOpenid;

    /**
     * 第三方用户身份认证口令
     */
    private String bindToken;

    /**
     * 第三方用户省份
     */
    private String bindProvince;

    /**
     * 第三方用户市区
     */
    private String bindCity;

    /**
     *
     */
    private String bindUnionid;

    /**
     * 手机号绑定appleid
     */
    private String bindAppleid;

    /**
     * 创建者
     */
    private String createUser;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 修改人
     */
    private String updateUser;

    /**
     * 修改时间
     */
    private Date updateTime;

    /**
     * 微信小程序是否自动登录 1是 2 否
     */
    private Integer isAutoLogin;

    /**
     * 是否删除0:否;1:是
     */
    private Integer isDelete;

    /**
     * 版本号
     */
    private Integer sysVersion;

    /**
     * 时间戳
     */
    private Date ts;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserBindConnectEntity other = (UserBindConnectEntity) that;
        return (this.getBindId() == null ? other.getBindId() == null : this.getBindId().equals(other.getBindId()))
            && (this.getBindType() == null ? other.getBindType() == null : this.getBindType().equals(other.getBindType()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getBindTime() == null ? other.getBindTime() == null : this.getBindTime().equals(other.getBindTime()))
            && (this.getBindNickname() == null ? other.getBindNickname() == null : this.getBindNickname().equals(other.getBindNickname()))
            && (this.getBindAvator() == null ? other.getBindAvator() == null : this.getBindAvator().equals(other.getBindAvator()))
            && (this.getBindOpenid() == null ? other.getBindOpenid() == null : this.getBindOpenid().equals(other.getBindOpenid()))
            && (this.getBindToken() == null ? other.getBindToken() == null : this.getBindToken().equals(other.getBindToken()))
            && (this.getBindProvince() == null ? other.getBindProvince() == null : this.getBindProvince().equals(other.getBindProvince()))
            && (this.getBindCity() == null ? other.getBindCity() == null : this.getBindCity().equals(other.getBindCity()))
            && (this.getBindUnionid() == null ? other.getBindUnionid() == null : this.getBindUnionid().equals(other.getBindUnionid()))
            && (this.getBindAppleid() == null ? other.getBindAppleid() == null : this.getBindAppleid().equals(other.getBindAppleid()))
            && (this.getCreateUser() == null ? other.getCreateUser() == null : this.getCreateUser().equals(other.getCreateUser()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateUser() == null ? other.getUpdateUser() == null : this.getUpdateUser().equals(other.getUpdateUser()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsAutoLogin() == null ? other.getIsAutoLogin() == null : this.getIsAutoLogin().equals(other.getIsAutoLogin()))
            && (this.getIsDelete() == null ? other.getIsDelete() == null : this.getIsDelete().equals(other.getIsDelete()))
            && (this.getSysVersion() == null ? other.getSysVersion() == null : this.getSysVersion().equals(other.getSysVersion()))
            && (this.getTs() == null ? other.getTs() == null : this.getTs().equals(other.getTs()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getBindId() == null) ? 0 : getBindId().hashCode());
        result = prime * result + ((getBindType() == null) ? 0 : getBindType().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getBindTime() == null) ? 0 : getBindTime().hashCode());
        result = prime * result + ((getBindNickname() == null) ? 0 : getBindNickname().hashCode());
        result = prime * result + ((getBindAvator() == null) ? 0 : getBindAvator().hashCode());
        result = prime * result + ((getBindOpenid() == null) ? 0 : getBindOpenid().hashCode());
        result = prime * result + ((getBindToken() == null) ? 0 : getBindToken().hashCode());
        result = prime * result + ((getBindProvince() == null) ? 0 : getBindProvince().hashCode());
        result = prime * result + ((getBindCity() == null) ? 0 : getBindCity().hashCode());
        result = prime * result + ((getBindUnionid() == null) ? 0 : getBindUnionid().hashCode());
        result = prime * result + ((getBindAppleid() == null) ? 0 : getBindAppleid().hashCode());
        result = prime * result + ((getCreateUser() == null) ? 0 : getCreateUser().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateUser() == null) ? 0 : getUpdateUser().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsAutoLogin() == null) ? 0 : getIsAutoLogin().hashCode());
        result = prime * result + ((getIsDelete() == null) ? 0 : getIsDelete().hashCode());
        result = prime * result + ((getSysVersion() == null) ? 0 : getSysVersion().hashCode());
        result = prime * result + ((getTs() == null) ? 0 : getTs().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", bindId=").append(bindId);
        sb.append(", bindType=").append(bindType);
        sb.append(", userId=").append(userId);
        sb.append(", bindTime=").append(bindTime);
        sb.append(", bindNickname=").append(bindNickname);
        sb.append(", bindAvator=").append(bindAvator);
        sb.append(", bindOpenid=").append(bindOpenid);
        sb.append(", bindToken=").append(bindToken);
        sb.append(", bindProvince=").append(bindProvince);
        sb.append(", bindCity=").append(bindCity);
        sb.append(", bindUnionid=").append(bindUnionid);
        sb.append(", bindAppleid=").append(bindAppleid);
        sb.append(", createUser=").append(createUser);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateUser=").append(updateUser);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", isAutoLogin=").append(isAutoLogin);
        sb.append(", isDelete=").append(isDelete);
        sb.append(", sysVersion=").append(sysVersion);
        sb.append(", ts=").append(ts);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
